{% extends "page.html.twig" %}

{% do gantry.theme.setLayout('_offline') %}

{% block content %}
    <h2>{{ offline_title }}</h2>

    {% if offline_message %}
    <p class="offline-message">
        {{ offline_message }}
    </p>
    {% endif %}

    {% if offline_image %}
    <img src="{{ offline_image }}" alt="{{ site.name }}" />
    {% endif %}

    {% if gantry.config.features.feedburner.enabled and gantry.config.features.feedburner.uri %}
    <section id="g-subscription-form">
        <p class="g-subscription-title">
            {{ offline_subscription_title }}
        </p>
        <form class="g-offline-form" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri={{ gantry.config.features.feedburner.uri }}', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
            <input type="text" placeholder="{{ _._('RT_EMAIL') }}" class="inputbox" name="email">
            <input type="hidden" value="{{ gantry.config.features.feedburner.uri }}" name="uri"/>
            <input type="hidden" name="loc" value="en_US"/>
            <input type="submit" name="Submit" class="button" value="{{ subscribe }}" />
        </form>
    </section>
    {% endif %}

    <section id="g-authorized-form">
        <h2>{{ _._("AUTHORIZED_LOGIN") }}</h2>

        <p>{{ _._("RT_OFFLINE_LOGIN_MESSAGE") }}</p>

        {% if not user.isRoot %}
        <form  action="{{ url()|e }}" method="post">
            <input name="username" id="username" class="inputbox" type="text" placeholder="{{ _._('JGLOBAL_USERNAME') }}" />
            <input type="password" name="password" class="inputbox" placeholder="{{ _._('JGLOBAL_PASSWORD') }}" />
            <input type="hidden" name="remember" class="inputbox" value="yes" id="remember" />
            <input type="submit" name="Submit" class="button" value="{{ _._('JLOGIN') }}" />
            <input type="hidden" name="option" value="com_users" />
            <input type="hidden" name="task" value="user.login" />
            <input type="hidden" name="return" value="{{ url()|base64 }}" />
            {{ formtoken }}
        </form>
        {% else %}
        <form action="{{ url()|e }}" method="post">
            <input type="submit" name="Submit" class="button" value="{{ _._('JLOGOUT') }}" />
            <input type="hidden" name="option" value="com_users" />
            <input type="hidden" name="task" value="user.logout" />
            <input type="hidden" name="return" value="{{ return }}" />
            {{ formtoken }}
        </form>
        {% endif %}
    </section>
{% endblock %}
